
   import React from 'react'
   import {HashRouter as Router , Link ,Route , Switch} from "react-router-dom"
   import Friend from '../Friend'
   import My from '../My'
   import Discover from '../Discover'
   import Custom from './Custom'
   class CustomLink extends React.Component{
       render(){
           return(
               <fieldset>
                   <legend>CustomLink</legend>
                   <Router>
                    <ul>
                        <li>
                            <Custom to= "/Friend">大仙</Custom>
                        </li>
                        {/* <li>
                            <Link to="/Discover">发现</Link>
                        </li> */}
                        <li>
                        <Custom  to = "/My">我的</Custom>
                        </li>
                    </ul>

                    {/* children属性 Route的一个属性 */}
                    {/* children属性 传递一个函数 函数返回jsx元素 作为视图的内容
                    可以加载组件 不需要不需要路径匹配成功也能加载组件 */}
                    {/* <Route path = "/aaa" children = {()=>{
                        return <My></My>
                    }}></Route> */}
                    <Route path="/Friend" component={Friend}></Route>
                     {/* <Route path="/Discover" component={Discover}></Route> */}
                     <Route path="/My" component={My}></Route>
                   </Router>
               </fieldset>
           )
       }
   }
   export default CustomLink